import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'

import Home from '../components/Home.vue'
import About from '../components/About.vue'
import News from '../components/News.vue'
import Detail from '../components/Detail.vue'

const router = createRouter({
  history: createWebHashHistory(), // 指定工作模式
  routes: [
    {
      path: '/home',
      component: Home
    },
    {
      path: '/about',
      component: About
    },
    {
      path: '/news',
      component: News,
      children: [
        {
          path: 'detail',
          component: Detail
        }
      ]
    }
  ]
})

export default router
